# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=graphql-path-enum
pkgver=23.5450280
pkgrel=1
pkgdesc='Tool that lists the different ways of reaching a given type in a GraphQL schema.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-webapp' 'blackarch-exploitation'
        'blackarch-fuzzer')
url='https://gitlab.com/dee-see/graphql-path-enum'
license=('Unlicense')
makedepends=('git' 'cargo')
source=("git+https://gitlab.com/dee-see/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  cargo build --release
}

package() {
  cd $pkgname

  install -Dm 755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

